package com.scommunity.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;

/**
 * 车位表
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "sc_parking")
public class Parking implements Serializable{
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.INPUT)
    private Long parkingId;
    private String parkingNum;
    private BigDecimal parkingPrice;
    private String parkingStatus;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private String rentTime;
    private Long carId;
    
    public Parking(Parking parking) {
        if (Objects.nonNull(parking)) {
            this.parkingId=parking.parkingId;
            this.parkingNum=parking.parkingNum;
            this.parkingPrice=parking.parkingPrice;
            this.parkingStatus=parking.parkingStatus;
            this.rentTime=parking.rentTime;
            this.carId=parking.carId;
        }
    }
}
